package com.xingongchang.baolebei.protocol;

import org.json.JSONException;
import org.json.JSONObject;

import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;

@Table(name = "UserInfo_dis")
public class UserInfo_dis {
	@Column(name = "id")
	public String id;

	@Column(name = "name")
	public String name;

	@Column(name = "rank_level")
	public int rank_level;

	@Column(name = "collection_num")
	public int collection_num;

	@Column(name = "sex")
	public int sex;
	
	@Column(name = "birthday")
	public String birthday;
	
	@Column(name = "email")
	public String email;
	
	@Column(name = "nickname")
	public String nickname;
	
	@Column(name = "rank_name")
	public String rank_name;
	
	@Column(name = "user_photo")
	public String user_photo;
	
	public static UserInfo_dis fromJson(JSONObject jsonObject)
			throws JSONException {
		if (null == jsonObject) {
			return null;
		}
		UserInfo_dis userinfo = new UserInfo_dis();
		userinfo.id=jsonObject.optString("id");
		userinfo.name=jsonObject.optString("name");
		userinfo.nickname=jsonObject.optString("nickname");
		userinfo.birthday=jsonObject.optString("birthday");
		userinfo.sex = jsonObject.optInt("sex");
		userinfo.email = jsonObject.optString("email");
		userinfo.birthday = jsonObject.optString("birthday");
		userinfo.rank_name=jsonObject.optString("rank_name");
		userinfo.collection_num=jsonObject.optInt("collection_num");
		return userinfo;
	}

	
}
